Parametricity for Haskell with Imprecise Error Semantics

نویسندگان

  • Florian Stenger
  • Janis Voigtländer
چکیده

Error raising, propagation, and handling in Haskell can be imprecise in the sense that a language implementation’s choice of local evaluation order, and optimizing transformations to apply, may influence which of a number of potential failure events hidden somewhere in a program is actually triggered. While this has pragmatic advantages from an implementation point of view, it also complicates the meaning of programs and thus requires extra care when reasoning about them. The proper semantic setup is one in which every erroneous value represents a whole set of potential (but not arbitrary) failure causes. The associated propagation rules are somewhat askew to standard notions of program flow and value dependence. As a consequence, standard reasoning techniques are cast into doubt, and rightly so. We study this issue in depth for one such reasoning technique, namely the derivation of free theorems from polymorphic types. We revise and extend the foundational notion of relational parametricity, as well as further material required to make

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Automated soundness checking of a programming logic for Haskell

P-logic is a verification logic for the programming language Haskell. Inference rules are expressed in sequent calculus for each of the term constructs of Haskell. Validating soundness of these rules is an essential task. Most rules of P-logic are polymorphic, independent of Haskell’s type classes. The paper develops a parametricity principle for predicates of P-logic, which justifies checking ...

متن کامل

Selective strictness and parametricity in structural operational semantics, inequationally

Parametric polymorphism constrains the behavior of pure functional programs in a way that allows the derivation of interesting theorems about them solely from their types, i.e., virtually for free. The formal background of such ‘free theorems’ is well developed for extensions of the Girard-Reynolds polymorphic lambda calculus by algebraic datatypes and general recursion, provided the resulting ...

متن کامل

Signed and sealed

Language constructs for defining abstract types commonly come in two varieties: those that add and remove seals dynamically as values cross the abstraction boundary, and those that define the boundary statically using a type signature. Abstract types in dynamically-typed languages are generally defined using seals whereas statically-typed languages more typically use a signature; two prominent ...

متن کامل

Final Report for EPSRC Grant EP/E016146/1 Relational Parametricity for Computational Effects

Polymorphism is a feature of many programming languages, including typed functional languages (e.g., SML, Haskell), and recent “generic” versions of Java. Relational parametricity, introduced by Reynolds in 1983, is a powerful principle for reasoning about polymorphic programs and types. Previously, relational parametricity has been mainly studied for the second-order lambda calculus, a simple,...

متن کامل

On completeness and parametricity in the realizability semantics of System F

A general approach to the realizability semantics of System F is obtained by considering closure operators over sets of λ-terms. We investigate completeness and relational parametricity in the semantics generated by such closure operators. We prove general results and show that they can be applied to several well-known semantics, as those arising from Tait’s saturatedness conditions and from Gi...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2009